#ifndef DBHANDLER_H_
#define DBHANDLER_H_

#define _DB_PATH_ "proto.db"


typedef struct
{
	char ** result;
	int nrow, ncol;
	char * zErrMsg;
} resultT;

void purgeDB(char * database);
int checklogin(char * database, char * pass, char * user);
int query(char * db, char * sql, resultT * rta);
int modification(char * db, char * sql);
void printRta(resultT rta, int start);
void sprintRta(resultT rta, int start, char ** s);
void freeR(resultT rta);
int dbfileExists(char * filename);
int checkDB(char * dbName);
int checkID(char * database, char * user);
void getFilenameByID(char * database, char * id, char * name);
int requestCatList(char * database, char ** output);
int requestUsrList(char * database, char ** output); 
int requestFList(char * database, char * cat, char ** output);
void logConn(char * db, int login, char * ip, char * file, short int state);
void unlogConn(char * db, int login, char * ip, char * file);
void printCons(char * db);


#endif /*DBHANDLER_H_*/

